package com.whj.domain.enums;

/**
 * @Auther: wanghaijun
 * @Date: 2023/5/22 - 05 - 22 - 8:59 
 * @Description: com.whj.domain.enums
 */

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_EXIST(501,"用户名已存在"),
    PHONENUMBER_EXIST(502,"手机号已存在"),
    EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    CONTENT_NOT_NULL(505,"评论不能为空"),
    LOGIN_ERROR(506,"用户名或密码错误"),
    FILE_TYPE_ERROR(507,"文件格式错误！"),
    USERNAME_NOT_NULL(508," 用户名不能为空"),
    PASSWORD_NOT_NULL(509, "用户密码不能为空"),
    EMAIL_NOT_NULL(510,"邮箱不能为空"),
    NICKNAME_NOT_NULL(511,"昵称不能为空"),
    NICKNAME_EXIST(512,"昵称存在"),
    NOT_ALLOW(514,"不允许删除"),
    NOT_ALLOW_USER(515,"不能删除当前登录用户！"),
    NAME_IS_EXISTS(516,"名称已存在"),
    URL_IS_EXISTS(516,"网站已存在"),
    TOKEN_ISNOT_EMPTY(513,"token不能为空");
    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
